package com.atguigu.springcloud;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

/**
 * @ClassName : com.atguigu.springcloud.PaymentMain8001
 * @Description : 类描述
 * Created by cyd on 2021-09-13 09:48:30
 */
@SpringBootApplication
// 说明本服务是EurekaClient服务端
@EnableEurekaClient
public class PaymentMain8002 {

    private static ConfigurableApplicationContext context;

    public static void main(String[] args) {
        context = SpringApplication.run(PaymentMain8002.class, args);
        System.out.println("--------------项目启动了---------------");
        ConfigurableEnvironment environment = context.getEnvironment();
        String port = environment.getProperty("server.port");
        System.out.println(port);
        System.out.println("http://localhost:" + port + "/payment/lb");
    }
}
